/*
 * Copyright 2016 Huawei Technologies Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openo.commsvc.protocolstack.netconf.service.svc.protocol.error;

import java.io.IOException;

/**
 * Transmission to read and write IO exception occurs, it may be due to the end
 * result.
 * 
 * @author
 * @see
 */
public class TransportIOException extends NetconfException {

    /**
     * (Domain of meaning, purpose, function)
     */
    private static final long serialVersionUID = -7054178443869887703L;

    /**
     * Constructor
     * 
     * @author
     * @see
     * @param arg
     * @param e
     */
    public TransportIOException(String arg, IOException e) {
        super(NetconfErrCode.SESSION_IOEXCEPTION, exceptionInfo(arg), e);
    }

    /**
     * Constructor
     * 
     * @author
     * @see
     * @param detail
     * @param e
     */
    public TransportIOException(String detail, Throwable e) {
        super(NetconfErrCode.SESSION_IOEXCEPTION, detail, e);
    }

    /**
     * Abnormal communication apparatus according to the description of the
     * parameter configuration.
     * 
     * @author
     * @see
     * @param arg
     * @return
     */
    private static String exceptionInfo(String host) {
        return "device connection exception:" + host;
    }
}
